import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/components/Home'
import Login from '@/components/Login'
import Register from "../components/Register"
import Course from "@/components/Course"
import Detail from "@/components/Detail"
import Cart from "@/components/Cart"
import Order from "@/components/Order"
import Success from "@/components/Success"
import Myorder from "@/components/Myorder"
import Player from "@/components/Player"



Vue.use(Router)

export default new Router({
  mode:'history',
  routes: [
    {
      path: '/',
      component: Home
    },
    {
       path: '/home',
       component: Home
    },
    {
      path:'/user/login',
      component: Login
    },
    {
      path:'/user/register',
      component: Register

    },
    {
      path: '/course',
      component: Course,
    },
    {
      path: '/course/detail/:id/',
      component: Detail
    },
        {
      path: '/cart/',   // /course/detail/1/   this.$route.params.id
      component: Cart
    },
    {
      path: '/order/',
      component: Order
    },
    {
      path: '/payment/result/',   // /course/detail/1/   this.$route.params.id
      // name: 'Home',
      component: Success
    },
     {
      path: '/myorder/',   // /course/detail/1/   this.$route.params.id
      // name: 'Home',
      component: Myorder
    },
    {
      path: '/polyv/player/:vid',   // /course/detail/1/   this.$route.params.vid
      // name: 'Home',
      component: Player
    },
  ]
})
